﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

// Reviewed

#pragma once

#include <vector>

namespace gcmp
{
    /// \brief  记录多边形中的边的环号和边号
    ///
    struct CoedgeIndex
    {
        /// 默认构造函数
        CoedgeIndex() : m_nLoopIndex(-1), m_nCoedgeIndex(-1) {}

        /// \brief     构造函数
        ///
        /// \param loopIndex    环序号
        /// \param coedgIndex   边序号
        CoedgeIndex(int loopIndex, int coedgeIndex) : m_nLoopIndex(loopIndex), m_nCoedgeIndex(coedgeIndex) {}
        
        /// 环号
        int m_nLoopIndex = 0;
        /// 边号
        int m_nCoedgeIndex = 0;
    };

    /// \brief  镜像前后边号的对应关系类
    ///
    class IMirrorCoedgeMap
    {
    public:
        virtual ~IMirrorCoedgeMap() {}


        /// \brief  已知初始边，求镜像之后的边
        ///
        /// \param initCoedgeIndex                 对应初始边号
        /// \param mirrorCoedgeIndex               镜像之后对应的边号
        /// \return 存在初始边返回true,否则返回false
        virtual bool GetCoedge(const CoedgeIndex &initCoedgeIndex, CoedgeIndex &mirrorCoedgeIndex) const = 0;
    };
}